import 'package:demo/model/chat.dart';
import 'package:demo/model/user.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

part './chat_state.dart';

class ChatCubit extends Cubit<ChatState> {
  ChatCubit(User toUser) : super(ChatState(dataList: [], toUser: toUser));

  addChat(Chat chat) {
    state.dataList.add(chat);
    emit(ChatState.clone(state));
  }
}
